<?php
    
  $aux = explode ( '|', isset($_GET['id']) ? $_GET['id'] : '' );
  $EducationUid = str_replace ( '"', '', $aux[0] );
  
  require_once ( PATH_PLUGINS . 'hr' . PATH_SEP . 'class.hr.php');
  $pluginObj = new hrClass ();

  require_once ( "classes/model/HrEducation.php" );
  //if exists the row in the database propel will update it, otherwise will insert.
  $tr = HrEducationPeer::retrieveByPK( $EducationUid  );
  
  if ( ( is_object ( $tr ) &&  get_class ($tr) == 'HrEducation' ) ) { 
     $fields['EDUCATION_UID'] = $tr->getEducationUid();
     $fields['EMPLOYEE_ID'] = $tr->getEmployeeId();
     $fields['INSTITUTE'] = $tr->getInstitute();
     $fields['COMPLETIONDATE'] = $tr->getCompletiondate();
     $fields['DEGREEEARNED_id'] = $tr->getDegreeearnedId();
     $fields['STATEASSIGNED_ID'] = $tr->getStateAssignedId();
     $fields['SEMESTERHOURS'] = $tr->getSemesterhours();
  }
  else
    $fields = array();  
  
  $G_MAIN_MENU = 'processmaker';
  $G_SUB_MENU = 'hr/menuhrEmployee';
  $G_ID_MENU_SELECTED = 'ID_HR_EMP';
  $G_ID_SUB_MENU_SELECTED = 'ID_HR_EDUCATION';


  $G_PUBLISH = new Publisher;
  $G_PUBLISH->AddContent('xmlform', 'xmlform', 'hr/hrEducationEdit', '', $fields, 'hrEducationSaveSS' );
  G::RenderPage('publish', 'blank');   
?>